import http from '@/utils/httpRequest'
export function getList(params) {
  return http({
          url: http.adornUrl('/searchbook/getlist'),
          method: 'get',
          params: params
        })
}

export function gethotList(params) {
  return http({
          url: http.adornUrl('/searchbook/gethotlist'),
          method: 'get',
          params: params
        })
}

export function getgroupList(params) {
  return http({
          url: http.adornUrl('/searchbook/querygroup'),
          method: 'get',
          params: params
        })
}

//图书分类
export function getbookcls(params) {
  return http({
          url: http.adornUrl('/searchbook/getcls'),
          method: 'get',
          params: params
        })
}

export  function  getbookclsnochild(params){
  return http({
    url: http.adornUrl('/searchbook/getbookclsnochild'),
    method: 'get',
    params: params
  })
}

export function getclsbycode(params) {
  return http({
          url: http.adornUrl('/searchbook/getclsbycode'),
          method: 'get',
          params: params
        })
}

export function getbookbyid(params) {
  return http({
          url: http.adornUrl('/searchbook/getonebyid'),
          method: 'get',
          params: params
        })
}

export  function toDetail(item) {
  this.$router.push({ path:'/booklistdetails',query:{id:item.id}})
}

export function saveOrUpdate(data) {
	return http({
            url: http.adornUrl(
              '/searchbook/saveorupdate'
            ),
            method: "post",
            data: data
        })
}

export function getcount(data) {
	return http({
            url: http.adornUrl(
              '/searchbook/getcount'
            ),
            method: "get",
            
        })
}

export function isFileExists(params){
  return http({
    url: http.adornUrl(
      '/searchbook/fileexists'
    ),
    params: params,
    method: "get",
    
})
}



//医学类
export function findpage(params) {
  return http({
          url: http.adornUrl('/searchbook/findpage'),
          method: 'get',
          params: params
        })
}

//文学类
export function findpagewx(params) {
  return http({
          url: http.adornUrl('/searchbook/findpagewx'),
          method: 'get',
          params: params
        })
}



export function download(params) {
  return http({
          url: http.adornUrl('/searchbook/download'),
          method: 'get',
          params: params
        })
}


export function deletebook(ids = []) {
	return http({
            url: http.adornUrl("/searchbook/delbook"),
            method: "post",
            data: http.adornData(ids, false)
          })
}